<?php
/**
 * Created by PhpStorm.
 * User: fly
 * Date: 2018\1\16 0016
 * Time: 13:30
 */

namespace common\models;

use yii\db\ActiveRecord;

class Search extends ActiveRecord{


    /**
     * 大厅搜索全部
     * @param $param  搜索条件 1.默认排序 2.时间逆序 3.关键词
     */
    public static function All($param){
        $keyWord = !empty($param['keyWord'])?['like',['package.title','project.title'],$param['keyWord']]:[];
        $orderD = !empty($param['orderD'])?$param['orderD']:'';
        $orderTime = !empty($param['orderTime'])?:'';

        $allData = (new \yii\db\Query())->from(Package::tableName())->leftJoin(Project::tableName())->where($keyWord);

        $allCount = $allData->count();
        var_dump($allData);
    }

    /**
     * 大厅搜索资产包
     * @param $param 搜索条件
     */
    public static function  Package($param){

    }

}